package co.yixiang.mall.biz.commission.mapper;

import co.yixiang.mall.common.product.domain.YxStoreProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface StoreProductService extends BaseMapper<YxStoreProduct> {

    @Select("select a.id,a.mer_id,a.image,a.slider_image,a.store_name," +
            "a.store_info,a.keyword,a.bar_code,a.cate_id,a.price,a.vip_price," +
            "a.ot_price,a.postage,a.unit_name,a.sort,a.sales,a.stock,a.is_show,a.is_hot," +
            "a.is_benefit,a.is_best,a.is_new,a.description,a.create_time,a.update_time,a.is_postage," +
            "a.is_del,a.mer_use,a.give_integral,a.cost,a.is_seckill,a.is_bargain,a.is_good,a.ficti," +
            "a.browse,a.code_path,a.is_sub,a.temp_id,a.spec_type,a.pv_value,a.is_add from yx_store_product a " +
            "left join yx_store_order_cart_info b on a.id = b.product_id left join yx_store_order c " +
            "on b.oid = c.id where c.id = #{orderId} a.add_up = #{addUp}")
    YxStoreProduct queryProduct(Long orderId,Integer addUp);
}
